package com.ruoyi.system.mapper;

import com.ruoyi.system.domain.EpmBlacklist;
import com.ruoyi.system.domain.EpmInformation;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface EpmBlacklistMapper {
    List<EpmBlacklist> list(EpmBlacklist epmBlacklist);

    @Insert("insert into epm_black_list (user_name,id_card) values (#{userName},#{idCard});")
    void insert(EpmBlacklist epmBlacklist);

    @Delete("delete from epm_black_list where black_list_id = #{blackListId} ")
    void delete(Integer blackListId);

    void update(EpmBlacklist epmBlacklist);

//    黑名单中有数据返回true
    @Select("select * from epm_black_list where user_name = #{name}")
    Boolean checkName(String name);

    @Select("select * from epm_black_list where id_card = #{idCard}")
    Boolean checkIdCard(String idCard);

    @Select("select * from epm_black_list where user_name = #{name} and id_card = #{idCard}")
    Boolean checkNameAndIdCard(String name, String idCard);
}
